package com.auction.service.impl;

import com.auction.common.dao.MyBaseServiceImpl;
import com.auction.entity.UserAddr;
import com.auction.mapper.UserAddrMapper;
import com.auction.service.UserAddrService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;
import java.util.Map;

@Service
public class UserAddrServiceImpl extends MyBaseServiceImpl<UserAddr, UserAddrMapper> implements UserAddrService {


    @Override
    public List<Map> getUserAddrByUserId(int user_id) {
        return baseMapper.getUserAddrByUserId(user_id);
    }

    @Override
    public int updateDefault(int newAddr, int oldAddr) {
        int res = baseMapper.updateNoDefault(oldAddr);

        return baseMapper.updateDefault(newAddr);
    }
}
